home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectDraw / FullScreenMode / readme.txt < prev    next >
Encoding:
Text File  |  2001-10-10  |  2.7 KB  |  64 lines

  1. //-----------------------------------------------------------------------------
  2. // 
  3. // Sample Name: FullScreenMode Sample
  4. // 
  5. // Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
  6. // 
  7. //-----------------------------------------------------------------------------
  8.  
  9.  
  10. Description
  11. ===========
  12.   FullScreenMode demonstrates the tasks required to initialize and run 
  13.   a full-screen DirectDraw application.
  14.  
  15. Path
  16. ====
  17.   Source: DXSDK\Samples\Multimedia\DDraw\FullScreenMode
  18.  
  19.   Executable: DXSDK\Samples\Multimedia\DDraw\Bin
  20.  
  21. User's Guide
  22. ============
  23.   FullScreenMode requires no user input. Press the ESC key to quit the program.
  24.  
  25. Programming Notes
  26. =================
  27.   The basic tasks to author a simple full-screen DirectDraw application are as follows:
  28.   
  29.   Initialize DirectDraw: 
  30.     1. Register a window class and create a window.  
  31.     2. Call DirectDrawCreateEx to create a DirectDraw object
  32.     3. Call SetCooperativeLevel to set the DirectDraw cooperative level 
  33.        to exclusive and full-screen. 
  34.     4. Call SetDisplayMode to set the display mode, for example 640x480x8.
  35.     5. Call CreateSurface to create a flipable primary surface with 1 back buffer.
  36.     6. Call GetAttachedSurface to obtain a pointer to the back buffer.
  37.     7. If the display mode was set to palettized color, a palette is needs 
  38.        to be created.  This sample displays a single bitmap so it can read the 
  39.        bitmap palette info to read and create a DirectDraw palette.  After a palette 
  40.        is created, call SetPalette to set the palette for the primary surface.
  41.     8. Create an off-screen plain DirectDraw surface, and load media content into it.  
  42.        For example, this sample calls DDUtil_CreateSurfaceFromBitmap() to do just 
  43.        this. 
  44.  
  45.   When the app is idle, and it is not hidden or minimized then render the next 
  46.   frame as follows:
  47.     1. If movement or animation is involved in the app, then calculate how much 
  48.        time has passed since the last time the frame was displayed.
  49.     2. Move or animate the app state based on how much time has passed.
  50.     3. Draw the current state into the backbuffer.
  51.     4. Call Flip to flip the contents of the backbuffer into the primary surface.  
  52.   
  53.   If the user alt-tabs away from the app, then the DirectDraw surface may be lost 
  54.   (resulting in a DirectDraw call returning DDERR_SURFACELOST), then handle it by:
  55.     1. Call RestoreAllSurfaces to have DirectDraw restore all the surfaces.  
  56.     2. Restoring a surface doesn't reload any content that existed in the surface 
  57.        prior to it being lost. So you must now redraw the graphics the surfaces 
  58.        once held.  For example, this sample handles this by calling 
  59.        DDUtil_ReDrawBitmapOnDDS()
  60.  
  61.  
  62.   
  63.   
  64.